package com.syg.toolkit;

import java.util.Random;

/**
 * 数学处理工具类
 */
public class MathKit {
    public static void main(String[] args){

    }

    /**
     * 生成随机验证码,处理长度不够6位的情况
     * @return
     */
    public static String generateRandomNumber(){
        Random randomNum = new Random();
        String num = randomNum.nextInt(999999)+"";
        StringBuffer sb = new StringBuffer();
        for (int i= 0;i<6-num.length();i++){
            sb.append("0");
        }
        num = sb.toString()+num;
        return num;
    }
}
